<script setup lang='ts'>
import { useGetCbProductDetail } from '@fl/api/supplier'

const props = defineProps<{
    categoryId: number | string
    id: string
    title: string
}>()

const { id, title } = toRefs(props)
const { data, isLoading } = useGetCbProductDetail(id)

const richValue = computed(() => {
    if (unref(title) === '编制说明') {
        return data.value?.explanation
    }
    return data.value?.calcRule
})
</script>

<template>
    <el-skeleton v-if="isLoading"
                 :rows="3"
    />

    <div v-else
         v-html="richValue"
    />
</template>
